import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class code2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        HashSet<String> set = new HashSet<>();
        while(n--!=0) {
            char[] s = in.next().toCharArray();
            Arrays.sort(s);
            set.add(new String(s));
        }
        System.out.println(set.size());
    }
}